<h2>Help Management</h2>
<div class="tabBox">
    <form action="<?php echo $this->url(array('module'=>'admin','controller'=>'help','action'=>'index'),'default',true); ?> " method="post" id="frmListhelp">
        <div class="content">
        <ul class="tab">
          	<li class="tabHandler active">List Help</li>
        </ul>
         <div class="search">
	<?php 
	echo $this->formSelect('iaction'
						, 	''
						, 	array()
						,	array('0' => 'Choose an action',
								  '1' => 'Remove',
								  '2' => 'Publish',
								  '3' => 'Unpublish',
								  '4' =>'Update order'))?>
		<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'help', 'action'=>'process'), 'default', true); ?>" title="Search"
		class="btnSubmit greenBtn searchBtn">Update
		</a>
		&nbsp;
		</div>
          <table class="tabContent">
            <tbody>
            <tr>
            	<th><input type="checkbox" id="chkAll" name="chkAll" class="checkall" /></th>
	                <th></th>
	                <th>Title</th>
	                <th>Order</th>
                    <th>Down</th>
	                <th>Up</th>
	                
	                <th>Status</th>
	                <th>Operations</th>
              	</tr>
            <?php if(isset($this->data) && is_array($this->data) && count($this->data)>0)
            {
            	foreach($this->data as $key => $item)
            	{
            		$id = $item['id'];
            		?>
            		<tr>
            		<td><input type="checkbox" id="idss[]" name="idss[]" value=<?php echo $item['id']?> /></td>
            		<td> <input type="hidden" name="ids[<?php echo $id;?>]" id="<?php echo $id ;?>" value="<?php echo isset($id)? $id:'';?>" > </td>
              			
              			<td width="60%" align="left">
              				<strong><a href="<?php echo $this->url(array('module' => 'admin' , 'controller' => 'help' , 'action' => 'add','id'=>$id),'default',true);?>"><?php echo $item['title'] .  '-'.$item['type'];?></a></strong>
              				<?php echo '<br />';
              					echo substr($item['description'],0,80).'...';
              				?>
              			</td>
              			<td width="5%">
              				<input name="sort[<?php echo $id;?>]" id="sort" size="2" value="<?php if(!empty($item['order'])){echo $item['order'] ;}?>"/> 
              			</td>
              			<td width="5%">
							<a class="btnDown" href="#">
								<img src="<?php echo $this->baseUrl()?>/images/down.png" width="16px" height="16px" alt="down" title="down" />
							</a>
						</td>
              			<td width="5%">
							<a class="btnUp" href="#">
								<img src="<?php echo $this->baseUrl()?>/images/up.png" width="16px" height="16px" alt="up" title="up" />
							</a>
						</td>
              			<td width="10%">
		                	<?php
								if(!empty($item['status']) && $item['status'] ==1){
									$urlPublish = $this->url(array('module' => 'admin' , 'controller' => 'help' , 'action' => 'change-status', 'id' => $item['id'], 'status' => 2), 'default', true);
									?> <label><a href="<?php echo $urlPublish?>" title="Published"><img
									src="<?php echo $this->baseUrl()?>/images/tick.png" width="16px" height="16px" alt="Published" /></a></label> <?php
								}else{
									$urlPublish = $this->url(array('module' => 'admin' , 'controller' => 'help' , 'action' => 'change-status', 'id' => $item['id'], 'status' => 1), 'default', true);
									?> <a href="<?php echo $urlPublish?>" title="Unpublished"><img
									src="<?php echo $this->baseUrl()?>/images/publish_x.png" width="16px" height="16px" alt="Unpublished" /></a> <?php 
								}
								?>
                		</td>
                		
                		<td width="20%">
                			<a href="<?php echo $this->url(array('module' => 'admin' , 'controller' => 'help' , 'action' => 'add','id'=>$id),'default',true);?>">edit</a>&nbsp;
                			<a class="lnkDelete" href="<?php echo $this->url(array('module' => 'admin' , 'controller' => 'help' , 'action' => 'delete','id'=>$id),'default',true);?>">delete</a>  
                		</td>
               
              		</tr>
            		<?php 
            		
            	}
            
            }?>
              
            </tbody>
          </table>
          	<div class="add">
          		<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'help', 'action'=>'add','type'=>'image'), 'default', true); ?>" class="blueBtn" title="Add">Add a txt/images rubric</a>
				<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'help', 'action'=>'add','type'=>'video'), 'default', true); ?>" class="blueBtn" title="Add">Add a txt/video</a>
        	</div>
          		<div class="tabBottom">
                   <?php  if (count($this->total)!=0 && ($this->total > $this->item_per_page))
                    {
						echo $this->pagination($this->pagination_config)->create_links();
					}
					?> 
                       
                </div>
        </div>
      </form>
</div>